// SHEditorReactor.h: interface for the SHEditorReactor class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SHEDITORREACTOR_H__F02A8F70_8E5D_4986_B4C1_4B18F2B006BA__INCLUDED_)
#define AFX_SHEDITORREACTOR_H__F02A8F70_8E5D_4986_B4C1_4B18F2B006BA__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class SHEditorReactor : public AcEditorReactor  
{
public:
	SHEditorReactor();
	virtual ~SHEditorReactor();

public:
    // Command Events
    //
    virtual void unknownCommand  (const char* cmdStr, AcDbVoidPtrArray *al);
    virtual void commandWillStart(const char* cmdStr);
    virtual void commandEnded    (const char* cmdStr);
    virtual void commandCancelled(const char* cmdStr);
    virtual void commandFailed   (const char* cmdStr);
 
    // Lisp Events
    //
    virtual void lispWillStart   (const char* firstLine);
    virtual void lispEnded       ();
    virtual void lispCancelled   ();

    virtual void beginClose(AcDbDatabase* pDwg);

    // DXF In/Out Events.
    //
    virtual void beginDxfIn      (AcDbDatabase*);
    virtual void abortDxfIn      (AcDbDatabase*);
    virtual void dxfInComplete   (AcDbDatabase*);
    //
    virtual void beginDxfOut     (AcDbDatabase*);
    virtual void abortDxfOut     (AcDbDatabase*);
    virtual void dxfOutComplete  (AcDbDatabase*);

    // DWG Open Events.
    //
    virtual void beginDwgOpen    (char* filename);
    virtual void endDwgOpen      (const char* filename);
    virtual void initialDwgFileOpenComplete(AcDbDatabase* pDwg);

    // DWG/Save Events.
    //
    virtual void dwgFileOpened(AcDbDatabase*, char* fileName);
    virtual void databaseConstructed(AcDbDatabase*);
    virtual void databaseToBeDestroyed(AcDbDatabase*);
    virtual void beginSave    (AcDbDatabase*, const char* pIntendedName);
    virtual void saveComplete (AcDbDatabase*, const char* pActualName);
    virtual void abortSave    (AcDbDatabase*); 

    // Insert Events.
    //
    virtual void beginInsert(AcDbDatabase* pTo, const char* pBlockName,
			     AcDbDatabase* pFrom);
    virtual void beginInsert(AcDbDatabase* pTo, const AcGeMatrix3d& xform,
			     AcDbDatabase* pFrom);
    virtual void otherInsert(AcDbDatabase* pTo, AcDbIdMapping& idMap,
			     AcDbDatabase* pFrom);
    virtual void abortInsert(AcDbDatabase* pTo);
    virtual void endInsert  (AcDbDatabase* pTo);

    // Wblock Events.
    //
    virtual void wblockNotice(AcDbDatabase* pDb);
    virtual void beginWblock(AcDbDatabase* pTo, AcDbDatabase* pFrom,
                             const AcGePoint3d*& insertionPoint);
    virtual void beginWblock(AcDbDatabase* pTo, AcDbDatabase* pFrom,
                             AcDbObjectId blockId);
    virtual void beginWblock(AcDbDatabase* pTo, AcDbDatabase* pFrom); 
    virtual void otherWblock(AcDbDatabase* pTo, AcDbIdMapping&,
                             AcDbDatabase* pFrom);
    virtual void abortWblock(AcDbDatabase* pTo);
    virtual void endWblock  (AcDbDatabase* pTo);

    // Deep Clone Events.
    //
    virtual void beginDeepClone       (AcDbDatabase* pTo, AcDbIdMapping&);
    virtual void beginDeepCloneXlation(AcDbIdMapping&, Acad::ErrorStatus*);
    virtual void abortDeepClone       (AcDbIdMapping&);
    virtual void endDeepClone         (AcDbIdMapping&);

    // Sys Var Events.
    //
    virtual void sysVarChanged        (const char* varName, Adesk::Boolean success);
    virtual void sysVarWillChange     (const char* varName);
 
    // XREF-related Events
    //
    virtual void beginAttach (AcDbDatabase* pTo, const char*,
			      AcDbDatabase* pFrom);
    virtual void otherAttach (AcDbDatabase* pTo, AcDbDatabase* pFrom);
    virtual void abortAttach (AcDbDatabase* pFrom);
    virtual void endAttach   (AcDbDatabase* pTo);
    virtual void redirected  (AcDbObjectId  newId, AcDbObjectId oldId);
    virtual void comandeered (AcDbDatabase* pTo, AcDbObjectId id,
			      AcDbDatabase* pFrom);
    virtual void beginRestore(AcDbDatabase* pTo, const char*,
			      AcDbDatabase* pFrom);
    virtual void abortRestore(AcDbDatabase* pTo);
    virtual void endRestore  (AcDbDatabase* pTo);

    // More XREF related Events
    // 
    virtual void xrefSubcommandBindItem   (int activity, AcDbObjectId blockId);
    virtual void xrefSubcommandAttachItem (int activity, const char* pPath);
    virtual void xrefSubcommandOverlayItem(int activity, const char* pPath);
    virtual void xrefSubcommandDetachItem (int activity, AcDbObjectId blockId);
    virtual void xrefSubcommandPathItem   (int activity, AcDbObjectId blockId, 
                                           const char* pNewPath);
    virtual void xrefSubcommandReloadItem (int activity, AcDbObjectId blockId);
    virtual void xrefSubcommandUnloadItem (int activity, AcDbObjectId blockId);

    // UNDO Events 
    //
    virtual void undoSubcommandAuto       (int activity, Adesk::Boolean state);
    virtual void undoSubcommandControl    (int activity, int option);
    virtual void undoSubcommandBegin      (int activity);
    virtual void undoSubcommandEnd        (int activity);
    virtual void undoSubcommandMark       (int activity);
    virtual void undoSubcommandBack       (int activity);
    virtual void undoSubcommandNumber     (int activity, int num);

    virtual void pickfirstModified();
    virtual void layoutSwitched(const char* newLayoutName);

    //window messages
    virtual void docFrameMovedOrResized(long hwndDocFrame, bool bMoved);
    virtual void mainFrameMovedOrResized(long hwndMainFrame, bool bMoved);

    //Mouse events
    virtual void beginDoubleClick(const AcGePoint3d& clickPoint);
    virtual void beginRightClick(const AcGePoint3d& clickPoint);

    // Toolbar Size changes
    virtual void toolbarBitmapSizeWillChange(Adesk::Boolean bLarge);
    virtual void toolbarBitmapSizeChanged(Adesk::Boolean bLarge);

    // WblockObjects - begin new pFrom database
    virtual void beginWblockObjects (AcDbDatabase* pFrom, AcDbIdMapping& );

    // Partial Open Events
    //
    virtual void partialOpenNotice(AcDbDatabase* pDb);
    virtual void objectsLazyLoaded(const AcDbObjectIdArray& idArray);

    // Quit Events
    virtual void beginQuit();
    virtual void quitAborted();
    virtual void quitWillStart();

    virtual void modelessOperationWillStart(const char* contextStr);
    virtual void modelessOperationEnded(const char* contextStr);

};

#endif // !defined(AFX_SHEDITORREACTOR_H__F02A8F70_8E5D_4986_B4C1_4B18F2B006BA__INCLUDED_)
